<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>
<?php
$this->load->view('admin/public_header');
?>
<div id="middle">
    <?php
    $this->load->view('admin/public_menu');
    ?>
	<style>input.laydate-icon{ width: 124px; }</style>
    <div class="right"  id="mainFrame">
        <div class="right_cont">
            <ul class="breadcrumb">
                <?php echo $breadcrumb;?>
            </ul>
            <div class="title_right">
            <form action="<?php echo site_url('admin/forum/tag');?>" method="get" id="search_form" style="padding:0px; margin:0px;">
                <span class="pull-right margin-bottom-5">                    
                    <a  class="btn btn-info btn-small" href="<?php echo site_url('admin/forum/tag/index/add');?>">
                        <i class="icon-plus icon-white"></i> 添加
                    </a>
                </span>
                标签名称:
                <input name="q" type="text" value="<?php echo $this->input->get('q');?>" />
                <a  class="btn btn-info btn-small" href="javascript:;" onclick="$('#search_form').submit();">
                    <i class="icon-search icon-white"></i> 查询
                </a>
            </form>
            </div>
			<?php if($total > 0):?>
            <table class="table table-bordered table-hover table-striped">
                <tbody>
                <tr align="center">
                	<td width="100"><strong>ID</strong></td>
                    <td width="50"><strong>标签名称</strong></td>
                    <td width="50"><strong>创建时间</strong></td>
                    <td width="100"><strong>操作</strong></td>
                   </tr>
				<?php foreach($result as $k=>$val):?>
                    <tr align="center">
                        <td align="center"><?php echo $val['id'];?></td>
                        <td align="center"><?php echo $val['name'];?></td>
                        <td align="center"><?php echo $val['create_at'];?></td>
                        <td align="center">
                            <a href="<?php echo site_url('admin/forum/tag/index/edit');?>?id=<?php echo $val['id'];?>">编辑</a>
                        </td>
                    </tr>
                <?php endforeach;?>
                </tbody>
            </table>
            <?php if($page_html):?>
            <table  class="margin-bottom-20 table  no-border" >
                <tr>
                    <td class="text-center"><div class="pagination"><?php echo $page_html;?></div></td>
                </tr>
            </table>
            <?php endif;?>
            
            <?php else:?>
            <table  class="margin-bottom-20 table  no-border" >
                <tr>
                    <td class="text-center">记录为空!</td>
                </tr>
            </table>
            <?php endif;?>
        </div>
    </div>

</div>
<script>
	$('a.status_opt').click(function(){
		if(!confirm('确认要'+$(this).text()+'?'))
		{
			return false;
		}
		var ajaxurl = $(this).attr('href');
		$.ajax({
			url      : ajaxurl,
			type     : 'post',
			cache    : false,
			dataType : 'json',
			success  :function(json) {
				if(json.error=='1')
				{
					alert(json.msg);
					return ;
				}
				else
				{
					alert(json.msg);
					window.location.reload(true);
				}
			}
		});
		return false;
	});
</script>
<?php
$this->load->view('admin/public_footer');
?>